﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="testJson.aspx.cs" Inherits="WebApp.testJson" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 <script language="javascript">
 function e()
 {
    var json=[{"kl_id":"2","kl_title":"Test date","kl_content":"Test date","kl_type":"1","id":"1"},{"kl_id":"2","kl_title":"Test","kl_content":"Test","kl_type":"1","id":"2"}]
    var str = "";
    var a = new Array("kl_id", "kl_test");
    for (var one in json)
    {
        for (var key in json[one]) {
            if (a.contains(key)) {
                alert(key);
            }
            str += json[one][key] + ",";
        }
    }
    document.form.txtName.value = str;
}
 document.re
 </script>
 </HEAD>

 <BODY>
<form name="form">
  <a href="#" onclick="e();">Click</a>
  <br>
  <input name="txtName" value="" type="text" size="50">
  </form>
 </BODY>
</HTML>